package com.eds.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.eds.dto.*;
import com.eds.pojo.BaseResult;
import com.eds.pojo.CourseTableDTO;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.pojo.*;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;


/**
 * @author 34195
 * @description 针对表【course】的数据库操作Service
 * @createDate 2025-03-21 11:10:41
 */
public interface CourseService extends IService<Course> {
    //1.分页查询所有课程
    PageUtils<Course> selectAllCourseService(int currentPage, int pageSize);

    //2.根据名称分页查询所有课程
    Page<Course> selectCourseByNameService(int currentPage, int pageSize, String name);

    //3.根据老师Id分页查询老师创建的课程
    Page<Course> selectCourseByTeacherIdService(int currentPage, int pageSize, Long teacherId);

    //4.根据课程Id查课程信息
    Course selectCourseByCourseIdService(Long courseId);

    //5.根据Token查课程信息
    List<Course> selectCourseByToken(String token);

    //6.通过课程ID查询老师信息
    User selectTeacherInfo(Long courseId);

    //7.增加课程
    BaseResult insertCourseService(String token, CourCreateRequest courCreateRequest) throws Exception;


    boolean delCourseService(String token, long courseId);

    BaseResult updateCourseService(String token, CourCreateRequest courCreateRequest) throws JsonProcessingException;

    //更新课程图片
    String updateCourseImg(String token, Long courseId, String relationType, MultipartFile file);

    //删除课程图片
    Boolean delCourseImg(String token, Long courseId, String relationType);

    //获取课程表
    List<TeacherSchedule> getCourseTable(Long courseId);

    //预约课程
    BaseResult bookCourse(String token, AppointmentRequestDTO appointmentRequest);

    //根据课程Id查询课程信息
    Course selectCourseInfoByScheduleId(String token, Long scheduleId);

    //取消预约课程
    BaseResult cancelBookCourse(String token, CancleRequestDTO cancleRequestDTO);

    //根据用户Id查询课程信息
    List<Course> selectCourseByUserId(String token);

    //更新预约状态
    int updateBookingStatus(Long scheduleId, int status);

    //查询预约信息
    CourseBooking selectBookingByScheduleIdAndCourseId(String token, Long scheduleId, Long courseId);

    //根据老师Id查询老师创建的课程
    List<Course> selectCourseByTeacherIdAIUsed(Long teacherId);

    //获取热门课程
    List<Course> getHotCourses(int amount);

    //获取所有课程
    List<CourseDesc> selectAllCourseList();

    //获取学生预约课程
    List<CourseTableDTO> selectStudentCourseBookingByUserId(String token);

    int deleteCourseByTeacherId(Long userId);

    //后台查询所有课程
    PageUtils<BackCourseDTO> selectAllCourseServiceForBack(int currentPage, int pageSize, String courseName);

    //修改课程价格
    BaseResult updateCoursePrice(Course course);


    //修改课程状态
    int updateCourseStatus(Course course);

    //后台删除课程
    boolean delCourseForBack(long courseId);

    //获取课程面板信息
    BackCourseBoardDTO getCourseBoard();
}
